﻿using System;
using System.Drawing;

namespace Hxsoft.AppV1._Controls
{
	public partial class CheckCodeImage : System.Web.UI.Page
	{
		protected void InitCheckCode()
		{
			CheckCode1.Font = new Font(FontFamily.GenericSansSerif, FontSize, FontStyle.Bold | FontStyle.Italic, GraphicsUnit.Pixel);
		}

		protected int FontSize
		{
			get
			{
				int fontSize = 0;
				string str = Request.QueryString["FontSize"];
				if (!Int32.TryParse(str, out fontSize))
					fontSize = 14;
				return fontSize;
			}
		}

		protected int Width
		{
			get
			{
				int width = 0;
				string str = Request.QueryString["Width"];
				Int32.TryParse(str, out width);
				return width;
			}
		}

		protected int Height
		{
			get
			{
				int height = 0;
				string str = Request.QueryString["Height"];
				Int32.TryParse(str, out height);
				return height;
			}
		}

		protected void Page_Load(object sender, EventArgs e)
		{
			InitCheckCode();
			Response.Expires = -1;
			Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
			Response.CacheControl = "no-cache";
		}
	}
}
